home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_12
/
9n12110a
< prev
next >
Wrap
Text File
|
1991-10-14
|
519b
|
18 lines
/* getcolor "member" function */
int circle_getcolor(CIRCLE *pc) { return pc->color; }
/* setcolor member function */
int circle_setcolor (CIRCLE *pc, int val); { return (pc->color
= val); }
/* define and initialize the action package */
CIRCLE_ACTIONS caction = { circle_getcolor, circle_setcolor
};
/* define CIRCLE c and hook it to the action pack */
CIRCLE c = { 10, 10, 5, 4, /* set x, y, radius and color
*/
&caction; /* set paction pointer in c to point to the
action package */
};